package com.blb.community_admin.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blb.community_admin.entity.SysDictType;
import com.blb.community_admin.mapper.SysDictTypeMapper;
import com.blb.community_admin.service.ISysDictTypeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author hkp
 */
@Service
public class SysDictTypeServiceImpl extends ServiceImpl<SysDictTypeMapper, SysDictType> implements ISysDictTypeService {

    @Resource
    private SysDictTypeMapper sysDictTypeMapper;

    /**
     * 分页查询（默认10条）
     *
     * @param current
     * @param size
     * @return
     */
    @Override
    public IPage<SysDictType> selectPage(Integer current, Integer size) {
        return sysDictTypeMapper.selectDictTypePage(new Page<SysDictType>(current, size));
    }

    @Override
    public IPage<SysDictType> selectByFuzzy(Integer current, Integer size, String dictName, String dictType, String status, String startTime, String endTime) {
        return sysDictTypeMapper.selectByFuzzy(new Page<>(current, size), dictName, dictType, status, startTime, endTime);
    }

}
